<?php
    $this->title = "Cadastro de tarefas";
    $this->headTitle($this->title);
    echo "<div class='titulo_etapa'>Etapa: ".$this->etapa."</div>"
?>
<a class="linkBtn" href="<?php echo $this->url(array('module'=>'default','controller'=>'tarefas','action'=>'add','etapa_id'=>$this->etapa_id));?>">Adicionar uma nova tarefa</a>
<a class="linkBtn" href="<?php echo $this->url(array('module'=>'default','controller'=>'etapas','action'=>'index'));?>">Voltar</a>
<table>
    <tr>
        <th>Ordem</th>
        <th>Tarefa</th>
        <th style="width:100px;">&nbsp;</th>
    </tr>
<?php
    $cont = 0;
    foreach($this->tarefas as $tarefa) :
        $cont++;
        if($cont % 2 == 0)
            echo '<tr class="even">';
        else
            echo '<tr class="odd">';
?>
        <td class="texto"><?php echo $this->escape($tarefa->ordem);?></td>
        <td class="texto"><?php echo $this->escape($tarefa->tarefa);?></td>
        <td>
        <a href="<?php echo $this->url(array('controller'=>'tarefas','action'=>'edit', 'id'=>$tarefa->id));?>">
        <img alt="Editar"  src="<?php echo $this->baseUrl().'/images/edit.png'; ?>"></a>
        <a href="<?php echo $this->url(array('controller'=>'tarefas','action'=>'delete', 'id'=>$tarefa->id,'etapa_id'=>$tarefa->etapa_id));?>">
        <img alt="Apagar"  src="<?php echo $this->baseUrl().'/images/trash.png'; ?>"></a>
        </td>
<?php echo "</tr>"; endforeach; ?>
</table>
